#!/bin/bash
#TEST_FILES_NUM=( 1 2 3 4 5 6 7 8 9 )
TEST_FILES_NUM=( 9 )

#BLOCK_COUNT_1=( 16 32 64 128 256 1024 2048 4096 8192 )
#BLOCK_SIZE_1=( 128 128 128 128 128 128 128 128 8192 )
BLOCK_COUNT_1=( 65536 )
BLOCK_SIZE_1=( 8192 )

BLOCK_COUNT_2=("${BLOCK_COUNT_1[@]}")
BLOCK_SIZE_2=("${BLOCK_SIZE_1[@]}")

FOLDER_PREF="test"
FILE_NAME_PREF="test_"
FILE=$FOLDER_PREF/$FILE_NAME_PREF


if [ ! -d $FOLDER_PREF ]
then
	mkdir $FOLDER_PREF
fi

for ((i = 0; i < ${#TEST_FILES_NUM[@]}; i++))
do
	#echo ${BLOCK_COUNT_1[$i]} ${BLOCK_COUNT_2[$i]}
	dd if=/dev/urandom bs=${BLOCK_SIZE_1[$i]} count=${BLOCK_COUNT_1[$i]} | hexdump -e '/4 "%08x" "\n"' | sort -r | tr -d '\n' | tac -rs .. | xxd -r -p > $FILE${TEST_FILES_NUM[$i]}
	dd if=/dev/urandom bs=${BLOCK_SIZE_2[$i]} count=${BLOCK_COUNT_2[$i]} | hexdump -e '/4 "%08x" "\n"' | sort -r | tr -d '\n' | tac -rs .. | xxd -r -p >> $FILE${TEST_FILES_NUM[$i]}
done
